//
//  CHSAudioPlayer.h
//  ChildHoodStemp
//
//  Created by 日东 罗 on 13-11-11.
//
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "ChildHoodMessage.h"
#import "MutiltimediaView.h"

@protocol CHSAudioPlayerDelegate <NSObject>
@optional
- (void)CHSAudioPlayerDidFinishPlayWithPlayer:(AVAudioPlayer *)play succesfulFlag:(BOOL)flag childMessage:(ChildHoodMessage *)childMessage;
- (void)CHSAudioPlayerStopPlayWithPlayer:(AVAudioPlayer *)play childMessage:(ChildHoodMessage *)childMessage;
@end

@interface CHSAudioPlayer : NSObject
{
    AVAudioPlayer *_audioPlayer;
}

@property (nonatomic, retain) AVAudioPlayer *audioPlayer;

+(CHSAudioPlayer *) sharedInstance;

- (BOOL)playSoundWithURL:(NSString *)path childMessage:(ChildHoodMessage *)childMessage;
- (void)handleNotification:(BOOL)state;
- (BOOL)stopSound;
@property (nonatomic, weak) id<CHSAudioPlayerDelegate> delegate;
@property (nonatomic, strong) ChildHoodMessage *childMessage;

@end
